<template>
	<view>

		<plugin v-if="PageCur=='plugin'"></plugin>
		<manage v-if="PageCur=='manage'" ref="manage"></manage>
		<member v-if="PageCur=='member'" ref="member"></member>
		<about v-if="PageCur=='about'" ref="about"></about>
		<view class="cu-bar tabbar bg-white shadow foot">
			<view class="action" @click="NavChange" data-cur="plugin">
				<view class='cuIcon-cu-image'>
					<image :src="'/static/tabbar/money' + [PageCur == 'plugin'?'_cur':''] + '.png'"></image>
				</view>
				<view :class="PageCur=='plugin'?'text-green':'text-gray'">价目</view>
			</view>
			<view class="action" @click="NavChange" data-cur="member">
				<view class='cuIcon-cu-image'>
					<image :src="'/static/tabbar/member' + [PageCur == 'member'?'_cur':''] + '.png'"></image>
				</view>
				<view :class="PageCur=='member'?'text-green':'text-gray'">成员</view>
			</view>
			<view class="action" @click="NavChange" data-cur="manage">
				<view class='cuIcon-cu-image'>
					<image :src="'/static/tabbar/manage' + [PageCur == 'manage'?'_cur':''] + '.png'"></image>
				</view>
				<view :class="PageCur=='manage'?'text-green':'text-gray'">管理</view>
			</view>
			<view class="action" @click="NavChange" data-cur="about">
				<view class='cuIcon-cu-image'>
					<image :src="'/static/tabbar/about' + [PageCur == 'about'?'_cur':''] + '.png'"></image>
				</view>
				<view :class="PageCur=='about'?'text-green':'text-gray'">关于</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
		return {
				PageCur: 'plugin'
			}
		},
		onShow() {
			if(this.PageCur === 'manage') {
				this.$refs.manage.refresh()
			}
			
		},
		
		methods: {
			NavChange: function(e) {
				this.PageCur = e.currentTarget.dataset.cur
			}
		}
	}
</script>

<style>

</style>
